package org.estela.comp;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;

public class LoadStellaProgram {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		InputStream in = LoadStellaProgram.class.getResourceAsStream("/program1.stella");
		
		double d = -3.4e-10;
		
		
		InputStreamReader reader = new InputStreamReader(in);
		BufferedReader buffReader = new BufferedReader(reader);
		String line;
		while ( (line = buffReader.readLine()) != null) {
			System.out.println(line);
		}
		
		EstelaProgram program = EstelaCompiler.compile(reader);
		
		System.out.println(program.size());
		
		List<Statement> statements = program.getStatements();
		for(Statement stmt : statements) {
			System.out.println(stmt);
		}
	}

}
